package it.tommasocortonesi.scjp.cap1;

public enum Enumeration002 {
	VALUE1(1),
	VALUE2(2),
	VALUE3(3){						// the "body" for this constant override 
		public int getValue() {		// the method defined in CoffeeSize
			return this.value+1;	// NOTE: the semicolon is REQUIRED 
		}							// when more code follows
	};
	
	int value;						// instance variable
	
	Enumeration002(int value) {		// constructor
		this.value = value;
	}
	
	public int getValue() {			// method
		return this.value;
	}

}
